package com.ruoyi.company.mapper;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.company.domain.Company;
import com.ruoyi.company.domain.CompanyAddress;
import com.ruoyi.company.domain.CompanyAudit;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CompanyMapper {
    /**
     * 新增 合作单位表
     *
     * @param company 合作单位信息
     * @return 新增的条数
     */
    public int insertCompany(Company company);

    public List<Company> mycompany(Long companyId);

    public int insertComPanyAddress(CompanyAddress companyAddress);

    public void insertCompanyAudit(CompanyAudit companyAudit);

    public void insertQuality(CompanyAudit companyAudit);

    public void updateQuality(CompanyAudit companyAudit);

    public void insertLegal(CompanyAudit companyAudit);

    public void updateComapnyName(Company company);

    public void updateLegal(CompanyAudit companyAudit);

    public void insertsaleAudit(CompanyAudit companyAudit);

    public void updatesaleAudit(CompanyAudit companyAudit);

    /**
     * 根据主键查询信息
     *
     * @param companyId 主键
     * @return 结果
     */
    Company selectByCompanyId(Long companyId);

    /**
     * 修改 合作单位信息
     *
     * @param company 合作单位信息
     * @return 结果
     */
    int updateCompany(Company company);

    int updateCompanyAddress(CompanyAddress companyAddress);

    public void deleteCompanyAddress(Long id);

    /**
     * 查询用户信息
     *
     * @param map 查询条件
     * @return 结果
     */
    List<SysUser> selectUserAndDept(Map<String, Long> map);

    List<SysUser> selectUserAndDeptUser(Map<String, Long> map);

    /**
     * 查询全部信息
     *
     * @return 结果
     */
    List<Company> selectAll();

    List<Company> selectSocialCreditCode();


    List<CompanyAddress> selectCompanyAddress(Long companyId);

    List<CompanyAddress> selectCompanyAddressById(Long companyId);

    Long selectCompanyAddressId(CompanyAddress companyAddress);

    CompanyAudit selectComapnyAudit(CompanyAudit companyAudit);

    Company selectCompany(Long companyId);

    /**
     * 通过公司的统一信用代码查询
     *
     * @param socialCreditCode 公司的统一代码
     * @return 结果
     */
    Company selectBySocialCreditCode(String socialCreditCode);

    List<Company> selectFhdz(@Param("loginName") String loginName);
}
